package com.vader.NIO;

import java.nio.Buffer;
import java.nio.IntBuffer;

/**
 * @author kaivader
 */
public class BasicBuffer {
    public static void main(String[] args) {
        IntBuffer intBuffer = IntBuffer.allocate(10);

       for (int i=0;i<intBuffer.capacity();i++){
           intBuffer.put(i*i);
       }

       intBuffer.flip();
       while (intBuffer.hasRemaining()){
           System.out.println(intBuffer.get());
       }


    }
}